package net.tngou.crawler.action;

import java.io.IOException;

import javax.servlet.ServletException;

import net.tngou.crawler.enums.MlTypeEnum;
import net.tngou.crawler.jdbc.PageUtil;
import net.tngou.crawler.pojo.Ml;

/**
 * 机器学习建模
 * @author tngou@tngou.net
 *
 */
public class MlAction extends BaseAction{

	@Override
	public void execute() throws ServletException, IOException {
		PageUtil page = service.getPage(ask.getPage(), ask.getRows(), Ml.class);
		root.put("types", MlTypeEnum.values());
		root.put("page", page);
		printFreemarker("ml.ftl", root);
	}
	
	public void update() {
		Ml ml = new Ml().get(ask.getId());
		if(ml==null)
		{
			run_404();return;
		}
		root.put("types", MlTypeEnum.values());
		root.put("ml", ml);
		printFreemarker("ml_update.ftl", root);
	}
}
